#pragma once

#include "CProimse.h"
#include "Param.h"
#include "ResultResponse.h"

class QNetworkReply;
class QNetworkAccessManager;

namespace Softwarer 
{
    using AxiosProimse = CProimse<ResultResponse>;

    class QAXIOS_EXPORT QAxios
    {
    private:
        QNetworkAccessManager *m_networkAccessManager;

    private:
        QAxios();

        AxiosProimse* createAxiosProimse(QNetworkReply *reply);

    public:
        static QAxios *axios(const QString& key);
        
        AxiosProimse *get(const QString& url, Query* query);

        AxiosProimse *post(const QString& url, IParam* param);

        ~QAxios();
    };
}